@import "../../../style/gn_bootstrap.less"; // must be first
// variables for manipulating the theme
@import "gn_variables_default.less"; // must be last

.navbar {
  margin-bottom: 0;
}
[ng-app^="gn_search_"] body, [ng-app="gn_login"] body {
  &.gn-header-fixed {
    .gn-top-bar {
      position: fixed;
      right: 0;
      left: 0;
      top: 0;
      z-index: 1030;
    }
    &.gn-logo-in-header {
      .gn-top-bar {
        top: @gn-header-height;
      }
    }
  }
}

.navbar-default {
  background-color: @gn-menubar-background;
  border-color: @gn-menubar-border-color;
  border-width: 0 0 1px 0;
  z-index: 100;
  border-radius: 0;
  .navbar-nav > li > a, .navbar-nav > .open > a, .navbar-nav > .active > a {
    height: @gn-menubar-height;
    color: @gn-menubar-color;
    &:hover, &:focus {
      color: @gn-menubar-color-hover;
      background-color: @gn-menubar-background-hover;
    }
    &:focus {
      outline: 2px auto -webkit-focus-ring-color;
    }
  }
  .btn {
    &:focus {
      outline: 2px auto -webkit-focus-ring-color;
      outline-offset: 0;
    }
  }
  .navbar-nav li.dropdown-hover.open:not(.active) > .dropdown-toggle {
    &:hover, &:focus {
      background-color: @gn-menubar-background-hover;
    }
    
  }
  .language-switcher {
    .form-control {
      &:focus {
        box-shadow: none;
        outline: 2px auto -webkit-focus-ring-color;
      }
    }
  }
  .dropdown-menu {
    > li {
      > a {
        padding: 8px 20px;
        &:focus {
          box-shadow: none;
          outline: 2px auto -webkit-focus-ring-color;
        }
      }
    }
    .dropdown-header {
      color: @gray;
      cursor: text !important;
    }
    .fa-fw {
      width: 2em;
    }
  }
  .navbar-nav > .active > a {
    background-color: @gn-menubar-background-active;
    color: @gn-menubar-color-active;
  }
  .gn-logo-link {
    padding: 10px 15px;
    .gn-logo {
      margin-top: -12px;
    }
    .gn-name {
      margin-top: 5px;
      display: inline-block;
      &.gn-truncate {
        @media (min-width: @screen-lg-min) {
          max-width: 230px;
          .text-overflow();
        }
      }
    }
  }

  // also add `display:none`, this doesn't take whitespace on the navbar
  .badge.invisible {
    display: none
  }
  input.ng-invalid, .has-error .form-control {
    border-color: @brand-danger;
    &:focus {
      box-shadow: none;
      outline: 2px auto @brand-danger;
    }
  }
  .gn-user-info {
    .gn-user-role {
      color: @gn-menubar-color;
      &:hover {
        color: @gn-menubar-color-hover;
      }
    }
  }
  // more small screen oriented menu options
  @media (max-width: @screen-xs-max) {
    padding-left: 0;
    padding-right: 0;
    .navbar-header {
      .btn-link {
        padding: 13px;
      }
    }
    .gn-logo-link {
      padding: 13px 0 13px 10px;
    }
    .navbar-collapse {
      background-color: #fff;
      padding: 15px;
      box-shadow: 0 2px 0.5px rgba(0, 0, 0, 0.1) !important;
    }
    .navbar-nav > li > a, .navbar-nav > .open > a, .navbar-nav > .active > a {
      background: none;
    }
    .navbar-nav .open .dropdown-menu > li > a {
      min-width: 0;
    }
    .navbar-accessible {
      .dropdown-menu {
        display: block;
        position: static;
        float: none;
        width: auto;
        margin-top: 0;
        background-color: transparent;
        border: 0;
        box-shadow: none;
        .gn-menuitem-xs {
          a {
            min-width: 0;
          }
        }
      }
      .username-dropdown {
        margin-top: 10px;
      }
      .navbar-form {
        width: calc(~"100% + 30px");
      }
    }
    .gn-clear-xs {
      clear: both;
    }
    .gn-menuheader-xs {
      margin-top: 5px;
      padding: 15px 0;
      height: auto;
      font-size: 16px;
      font-weight: 400;
      clear: both;
      i {
        display: none;
      }
      &:hover {
        background: none !important;
        color: @gray-base;
      }
    }
    .gn-menu-xs {
      padding: 1px;
      overflow-y: hidden !important;
      max-height: none;
      .clearfix();
      .gn-separator-xs {
        display: none;
      }
      .gn-menuitem-xs {
        width: calc(~"33% + 2px");
        height: 64px;
        text-align: center;
        border: 1px solid @navbar-default-border;
        background-color: @body-bg;
        float: left;
        margin-left: -1px;
        margin-top: -1px;
        a {
          color: @gn-menubar-color;
          display: block;
          padding: 7px 20px !important;
          height: auto;
          span {
            display: block;
            max-width: 100%;
            white-space: nowrap;
            overflow: hidden;
            text-overflow: ellipsis;
          }
          .fa {
            display: inline-block;
            font-size: 22px;
            // margin: 3px auto;
          }
          [data-gnv-layer-indicator] {
            display: none;
          }
          &:hover, &:focus {
            background-color: @dropdown-link-hover-bg !important;
          }
        }
      }
    }
    .username-dropdown {
      .gn-menuitem-xs {
        width: 50%;
        height: 46px !important;
        border: 1px solid @navbar-default-border;
        background-color: @body-bg;
        float: left;
        margin-left: -1px;
        margin-top: -1px;
        min-width: 0;
        img {
          display: none;
        }
        &:hover {
          border-color: @navbar-default-border;
          background-color: @dropdown-link-hover-bg !important;
        }
      }
    }
    .signin-dropdown {
      .navbar-form {
        flex-direction: initial;
        display: block !important;
        padding: 0;
        margin: 0;
        border: 0;
        .clearfix();
        // username & password input
        .form-group-sm {
          width: 84%;
          float: left;
          .form-control {
            height: 34px;
            padding: 6px 12px;
            font-size: 14px;
          }
        }
        // submit button
        .btn.pull-right {
          width: 14%;
          height: 73px;
          margin-top: -39px;
        }
      }
    }
    .language-switcher {
      padding: 10px 15px;
      .form-control {
        width: calc(~"100% - 3px");
      }
    }
    @media (min-width: @screen-sm-min) {
      li.dropdown-hover {
        &.open:not(.active) > .dropdown-toggle {
          &:hover, &:focus {
            background-color: @gn-menubar-background-hover;
          }
        }
      }
    }
  }

}

@media (max-width: @grid-float-breakpoint) {
  .navbar-nav {
    margin: 0;
  }
}

// nojs styles
.gn-nojs {
  .gn-logo {
    max-height: 28px;
    margin: -8px 0px;
  }
}